<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% 
String path = request.getContextPath(); //跳转后样式丢失问题
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 	
%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/bootstrap.css" />
    <link rel="stylesheet" href="<%=path%>/background/style/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/css/sweetalert.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/style.css" />
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/jquery.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/ckform.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/common.js"></script>
   	<script type="text/javascript" src="<%=path%>/background/style/js/sweetalert.min.js"></script>
	<script type="text/javascript" src="<%=path%>/background/style/js/sweetalert-dev.js"></script>
 	 <script type="text/javascript" src="<%=path%>/background/style/js/navgiation.js"></script>
	<style>
		.table  th{
			text-align:center;
		}
		.table td{
			text-align:center;
		}
		a{
			cursor:pointer;
		}
    </style>
	<script>
	$(function(){
		$("#t1").click(function(){
			$("#t12").toggle();
		})
	})
	
	</script>
</head>
<body>
<form class="form-inline definewidth m20">  
	<button type="button" class="btn btn-success" id="addnew" data-toggle="modal"
		data-target="#addModal">添加导航</button>
</form>
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th>ID</th>
				<th>导航名称</th>
				<th>链接地址</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody id="tbody">
			
		</tbody>
	</table>
		
	<!-- 修改 框（Modal） -->
	<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">修改导航</h4>
				</div>
				<div class="modal-body">
					<input type="hidden" class="span6" name="id" id="nid">
					<input type="text" class="span6" name="name" id="Newname">
				</div>
				<div class="modal-footer">
					<input type="button" class="btn btn-primary" onclick="updateNav()" value="更改">
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	
	
	<!-- 添加 框（Modal） -->
	<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">添加导航</h4>
				</div>
				<div class="modal-body">
					<input type="text" class="span6" name="name" id="Nname" placeholder="请输入导航名称">
					<input type="text" class="span6" name="address" id="addr" placeholder="请输入导航链接">
					<input type="hidden" class="span6" name="pid" id="pid" value="0">
				</div>
				<div class="modal-footer">
					<input type="button" class="btn btn-primary" onclick="addNav()" value="提交">
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
</body>
</html>